/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Emmanuel
 */
@Entity
@Table(name = "contentindex", catalog = "bloodhound", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Contentindex.findAll", query = "SELECT c FROM Contentindex c"),
    @NamedQuery(name = "Contentindex.findById", query = "SELECT c FROM Contentindex c WHERE c.id = :id"),
    @NamedQuery(name = "Contentindex.findByTermino", query = "SELECT c FROM Contentindex c WHERE c.termino = :termino"),
    @NamedQuery(name = "Contentindex.findByNr", query = "SELECT c FROM Contentindex c WHERE c.nr = :nr"),
    @NamedQuery(name = "Contentindex.findByTf", query = "SELECT c FROM Contentindex c WHERE c.tf = :tf")})
public class Contentindex implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Size(max = 100)
    @Column(name = "termino")
    private String termino;
    @Column(name = "nr")
    private Integer nr;
    @Column(name = "tf")
    private Integer tf;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "contentindex")
    private List<Post> postList;

    public Contentindex() {
    }

    public Contentindex(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTermino() {
        return termino;
    }

    public void setTermino(String termino) {
        this.termino = termino;
    }

    public Integer getNr() {
        return nr;
    }

    public void setNr(Integer nr) {
        this.nr = nr;
    }

    public Integer getTf() {
        return tf;
    }

    public void setTf(Integer tf) {
        this.tf = tf;
    }

    @XmlTransient
    public List<Post> getPostList() {
        return postList;
    }

    public void setPostList(List<Post> postList) {
        this.postList = postList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contentindex)) {
            return false;
        }
        Contentindex other = (Contentindex) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Contentindex[ id=" + id + " ]";
    }
    
}
